#pragma once

#include "HSModelAPI.h"
#include "HeightMap.h"
#include "GroundTypes.h"
#include "GameController.h"
#include "Water.h"
#include "FindWaterAreas.h"

#include <string>
#include <boost/property_tree/ptree.hpp>
#include <memory>

class World;

/**
*  This class is used to save World info to an XML file
*/
class WorldDumper
  {
  public:
    HSMODEL_API WorldDumper(World &io_world, GameController& i_game_controller, const std::string &i_filename);

    HSMODEL_API void Dump();
    HSMODEL_API bool Restore();

  private:
    void _DumpGround();
    TGroundTypeMap _RestoreGroundTypes();
    
    void _DumpHumans();
    void _RestoreHumans();
		
    HeightMap _RestoreHeightMap();
		
    void _DumpTrees();
		void _RestoreTrees();
    
    void _DumpFerrisWheels();
    void _RestoreFerrisWheels();
    
    void _DumpBenches();
    void _RestoreBenches();
    
    void _DumpGameInfo();
    void _RestoreGameInfo();
    
    void _DumpBalloonsShops();
    void _RestoreBalloonsShops();

    void _DumpWater();
    void _RestoreWater();
  private:
    World &m_world;
    GameController& m_game_controller;
    std::string m_filename;
    boost::property_tree::ptree m_ptree;
  };

